a = 99
def outer():

    num = 10

    def inner():
        global a
        nonlocal num   # nonlocal关键字声明
        a = 199 #在函数内部作用域中新建了一个a的变量
        num = 100

        print(num ,a)

    inner()

    print(num)

outer()
print(a)